function isEmpty(value){	
	if (value == null || value == undefined || value == '') { 
		return true;
	}
	else return false; 
}

function check_mobile(mobile){
	var flag	=	false;
	var value	=	$.trim(mobile);
	myreg		=	/^(1[3|4|5|8|7][0-9]{9})$/
	if(myreg.test(value))	flag	=	true;
	return flag;
}
$("#product_content").find("li").on("click",function(){		
		var select_value = $(this).attr("data-value");
		$(this).parent("ul").attr("select-value",select_value);	
		$(this).attr("class","selected").siblings(".selected").removeAttr("class");
		var res = [];
		var property_flag = true;		
		 $("#product_content").find("ul").each(function(i,e) {
				var x = $(e).attr("select-value");
				if(isEmpty(x)){
					property_flag = false; return;
				};
				res.push(x);				
			});	
		if(property_flag){
			$(".well").show();
			var x = 0;
			var price = parseInt($(".product_price").data('price'));
			
			$.each(res,function(i,e){							
				x += parseInt(e);	
			})
			var result = price-x;
			result = result>0?result:0;	
			$("input[name^='order_price']").val(result);
			var order = new Object();
			$("#product_content").find("ul").each(function(i,e) {						
				var key = $(e).parent("dd").prev("dt").html();
				var value = $(e).find(".selected .choix-name").html();
				order[key] = value;
			});				
			$("input[name^='order_json']").val(JSON.stringify(order));
			$("#is_lock").val(1);
		}	
	})